/**
  ******************************************************************************
  * @file    gt32f030_awk.c
  * @author  GT Application Team
  * @version V1.0.0
  * @date    03-January-2025
  *       
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2022 Giantec Semicondutor Inc</center></h2>
  *
  *             http://www.giantec-semi.com/
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GT32F030_AWK_H
#define __GT32F030_AWK_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "gt32f030.h"

/** @addtogroup GT32F030_StdPeriph_Driver
  * @{
  */

/** @addtogroup AWK
  * @{
  */ 

/* Exported macro ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/

/** @defgroup AWK_Exported_Constants
  * @{
  */ 
	 
#define IS_AWK_HXTPRESCAL(HXTPRESCAL) ((HXTPRESCAL) <= 0xFF)
#define IS_AWK_RELOAD(RELOAD)         ((RELOAD) <= 0xFF)	 


/**
  * @}
  */


/** @defgroup AWK_CLKPreScale_define 
  * @{
  */ 
typedef enum
{ 
  AWK_CLKPreScale_Div2       = 0x00,
  AWK_CLKPreScale_Div4       = 0x01,
	AWK_CLKPreScale_Div8       = 0x02,
	AWK_CLKPreScale_Div16      = 0x03,
	AWK_CLKPreScale_Div32      = 0x04,
	AWK_CLKPreScale_Div64      = 0x05,
	AWK_CLKPreScale_Div128     = 0x06,
	AWK_CLKPreScale_Div256     = 0x07,
	AWK_CLKPreScale_Div512     = 0x08,
	AWK_CLKPreScale_Div1024    = 0x09,
	AWK_CLKPreScale_Div2048    = 0x0A,
	AWK_CLKPreScale_Div4096    = 0x0B,
	AWK_CLKPreScale_Div8192    = 0x0C,
	AWK_CLKPreScale_Div16384   = 0x0D,
	AWK_CLKPreScale_Div32768   = 0x0E,
	AWK_CLKPreScale_Div65536   = 0x0F	
}AWKCLKPreScaleDiv_TypeDef;
#define IS_AWK_CLKPRESCALEDIV(CLKPRESCALEDIV) ((CLKPRESCALEDIV) <= 0x0F)
/**
  * @}
  */

/**
  * @}
  */



/* Exported types ------------------------------------------------------------*/
/** 
  * @brief   AWK Init structure definition  
  */  
typedef struct 
{
  AWKCLKPreScaleDiv_TypeDef  AWK_CLKPreScaleDiv;	
  FunctionalState            AWK_Cmd;
	uint16_t          AWK_HXTPreScale; 	
	uint8_t           AWK_Reload; 
}AWK_InitTypeDef;


/* Exported functions --------------------------------------------------------*/
void AWK_DeInit(void);
void AWK_Init(AWK_InitTypeDef* AWK_InitStruct);
void AWK_StructInit(AWK_InitTypeDef* AWK_InitStruct);

void AWK_Cmd(FunctionalState NewState);
void AWK_SetReloadVal(uint8_t Reload);

ITStatus AWK_GetIT(void);
void AWK_ClearIT(void);

#ifdef __cplusplus
}
#endif

#endif /* __GT32F030_AWK_H */

/**
  * @}
  */ 

/**
  * @}
  */ 

/************************ (C) COPYRIGHT Giantec Semicondutor Inc *****END OF FILE****/
